/*******************************************************************************
 * utilities.js
 * 
 * @author 				Joe Cianflone
 * @version 			2.0
 * @copyright 			CC, Creative Commons Attribution-ShareAlike 3.0 Unported -- http://creativecommons.org/licenses/by-sa/3.0/
 * @projectDescription 	These are important utility functions that should not
 * 						have to be rewritten.  We use these in multiple projects
 * 						and need them in multiple places.  
 ******************************************************************************/
function toggleChild (evt) {
	var element = Event.element(evt);

	var toggler = element.next();
	if (toggler == null) {
		toggler = element.up();
		toggler = toggler.next();
	}//if...
	Effect.toggle(toggler, 'blind', {duration:1});
}//dropChild()...

function copyright (loc, statement) {
	var d = new Date();
	
	var childNode = document.createTextNode(d.getFullYear()+ " "+statement);
	$(loc).appendChild(childNode);
}//copyright()...

function externalLinks() {
	try {
		var anchors = document.getElementsByTagName("a");
		for (var i=0, len=anchors.length; i < len; ++i) {
			if (anchors[i].getAttribute("rel") == "external") {
				anchors[i].target = "_blank";
			}//if...
		}//for...
	}//try...
	catch (e) {
		return 0;
	}//catch...
}//externalLinks()...